package cn.wusifx.zabbix.request.builder.template;

import cn.wusifx.zabbix.request.BaseRequest;
import cn.wusifx.zabbix.request.builder.RequestBuilder;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/template/massremove
 */
public class TemplateMassremoveRequestBuilder extends RequestBuilder<Map<String,Object>> {
    private List<String> templateIds;
    public TemplateMassremoveRequestBuilder(String auth) {
        super("template.massremove", auth);
        baseRequest.setParams(new HashMap<>());
    }

    public TemplateMassremoveRequestBuilder(Long id, String auth) {
        super("template.massremove", id, auth);
        baseRequest.setParams(new HashMap<>());
    }
    public TemplateMassremoveRequestBuilder setParam(String key, Object value){
        baseRequest.getParams().put(key,value);
        return this;
    }

    public TemplateMassremoveRequestBuilder setParams(Map<String,Object> params){
        baseRequest.getParams().putAll(params);
        return this;
    }

    public List<String> getTemplateIds() {
        return templateIds;
    }

    public TemplateMassremoveRequestBuilder setTemplateIds(List<String> templateIds) {
        this.templateIds = templateIds;
        return this;
    }

    @Override
    public BaseRequest<Map<String, Object>> builder() {
        baseRequest.getParams().put("templateids",templateIds);
        return baseRequest;
    }
}
